# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudErrorReporting.V1beta1.Model.HttpRequestContext do
  @moduledoc """
  HTTP request data that is related to a reported error. This data should be provided by the application when reporting an error, unless the error report has been generated automatically from Google App Engine logs.

  ## Attributes

  *   `method` (*type:* `String.t`, *default:* `nil`) - The type of HTTP request, such as `GET`, `POST`, etc.
  *   `referrer` (*type:* `String.t`, *default:* `nil`) - The referrer information that is provided with the request.
  *   `remoteIp` (*type:* `String.t`, *default:* `nil`) - The IP address from which the request originated. This can be IPv4, IPv6, or a token which is derived from the IP address, depending on the data that has been provided in the error report.
  *   `responseStatusCode` (*type:* `integer()`, *default:* `nil`) - The HTTP response status code for the request.
  *   `url` (*type:* `String.t`, *default:* `nil`) - The URL of the request.
  *   `userAgent` (*type:* `String.t`, *default:* `nil`) - The user agent information that is provided with the request.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :method => String.t() | nil,
          :referrer => String.t() | nil,
          :remoteIp => String.t() | nil,
          :responseStatusCode => integer() | nil,
          :url => String.t() | nil,
          :userAgent => String.t() | nil
        }

  field(:method)
  field(:referrer)
  field(:remoteIp)
  field(:responseStatusCode)
  field(:url)
  field(:userAgent)
end

defimpl Poison.Decoder, for: GoogleApi.CloudErrorReporting.V1beta1.Model.HttpRequestContext do
  def decode(value, options) do
    GoogleApi.CloudErrorReporting.V1beta1.Model.HttpRequestContext.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudErrorReporting.V1beta1.Model.HttpRequestContext do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
